<!--
 * @Descripttion: 
 * @version: 
 * @Author: ada.wu
 * @Date: 2025-07-02 02:24:59
 * @LastEditors: ada.wu
 * @LastEditTime: 2025-07-04 00:03:39
-->
<div class="layuimini-main">
    <div class="layui-form layuimini-form">

        <div class="flex items-start mb-5">
            <input type="text" name="time" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入" value="" class="layui-input">
        </div>

        <div class="layui-form-item t-r">
            <button class="layui-btn layui-btn-primary layui-btn-sm btn-70" lay-on="closeBtn">取消</button>
            <button class="layui-btn layui-btn-normal layui-btn-sm btn-70" lay-submit lay-filter="saveBtn">保存</button>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            util = layui.util,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();
        // 普通事件
        util.on('lay-on', {
            // 关闭弹出层
            "closeBtn": function () {
                layer.close(parentIndex);

            }
        });
        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var index = layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            }, function () {

                // 关闭弹出层
                layer.close(index);
                layer.close(parentIndex);

            });


            return false;
        });

    });
</script>